#include "cpu/exec/template-start.h"

#define instr add

static void do_execute() {
	DATA_TYPE ret = op_dest -> val + op_src -> val;
	OPERAND_W(op_dest, ret);

	cpu.eflags.CF = (ret < op_dest -> val);
	int t1 = MSB(op_dest -> val);
	int t2 = MSB(op_src -> val);
	cpu.eflags.OF = (t1 == t2 && t1 != cpu.eflags.SF);
	update_eflags_pf_zf_sf(ret);
	print_asm_template2();
}

make_instr_helper(i2a);
make_instr_helper(i2rm);
make_instr_helper(r2rm);
make_instr_helper(rm2r);

#if DATA_BYTE == 2 || DATA_BYTE == 4
make_instr_helper(si2rm)
#endif

#include "cpu/exec/template-end.h"

